<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<TXLifeResponse>
			<TransRefGUID>
				<xsl:value-of select="response-head/trans-id"/>
			</TransRefGUID>
			<!--交易流水号 transNo-->
			<TransType tc="103">新业务</TransType>
			<!--交易类型 transType-->
			<TransSubType tc="10304">电子化承保</TransSubType>
			<!--交易子类型-->
			<TransResult>
				<xsl:choose>
					<xsl:when test="insupost-response/response-head/trans-result = 0">
						<!--ResultCode 例如tc=1为成功 tc=5为失败-->
						<ResultCode tc="1">success</ResultCode>
						<!--此节点通常用来描述整个交易是成功或是失败-->
						<ResultInfo>
							<!--unbound-->
							<ResultInfoCode tc="0000">交易成功</ResultInfoCode>
							<!--结果信息 结果代码为0000时，显示“交易成功”-->
							<ResultInfoDesc/>
							<!--此节点可进一步描述结果信息-->
						</ResultInfo>
						<xsl:for-each select="insupost-response/response-head/validity-errors/validity-error">
							<ResultInfo>
								<!--unbound-->
								<ResultInfoCode>
									<xsl:value-of select="error-code"/>
								</ResultInfoCode>
								<!--结果信息 结果代码为0000时，显示“交易成功”-->
								<ResultInfoDesc>
									<xsl:value-of select="error-desc"/>
								</ResultInfoDesc>
								<!--此节点可进一步描述结果信息-->
							</ResultInfo>
						</xsl:for-each>
					</xsl:when>
					<xsl:otherwise>
						<ResultCode tc="5">fail</ResultCode>
						<!--此节点通常用来描述整个交易是成功或是失败-->
						<xsl:for-each select="insupost-response/response-head/validity-errors/validity-error">
							<ResultInfo>
								<!--unbound-->
								<ResultInfoCode>
									<xsl:value-of select="error-code"/>
								</ResultInfoCode>
								<!--结果信息 结果代码为0000时，显示“交易成功”-->
								<ResultInfoDesc>
									<xsl:value-of select="error-desc"/>
								</ResultInfoDesc>
								<!--此节点可进一步描述结果信息-->
							</ResultInfo>
						</xsl:for-each>
					</xsl:otherwise>
				</xsl:choose>
			</TransResult>
			<OLifE>
				<Holding id="Holding_1">
					<Policy>
						<PolicyStatus>
							<xsl:value-of select="insupost-response/response-underwriting/policy-info/policy-status"/>
						</PolicyStatus>
						<!--保单状态 -->
						<ApplicationInfo>
							<OLifEExtension xsi:type="ApplicationInfoExtension" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
								<HOAppFormState>
									<xsl:value-of select="insupost-response/response-underwriting/policy-info/policy-status"/>
								</HOAppFormState>
								<!--投保单状态 proposalState -->
							</OLifEExtension>
						</ApplicationInfo>
					</Policy>
				</Holding>
			</OLifE>
			<OLifEExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TXLifeResponseExtension">
				<UnderWritingPass>
					<xsl:value-of select="insupost-response/response-underwriting/uw-result"/>
				</UnderWritingPass>
				<!--是否满足核保规则 uwPass-->
			</OLifEExtension>
		</TXLifeResponse>
	</xsl:template>
</xsl:stylesheet>
